<template>
  <div id="version-log">
    <div class="w main">
      <div class="title">版本记录</div>
      <div class="a-list">
        <div class="list-tr header">
          <div>版本号</div>
          <div>说明</div>
          <div>更新时间</div>
        </div>
        <div v-for="item in algoItem.algorithmVersionInfoVOS" :key="item.versionName" class="list-tr">
          <div><i class="ri-file-line icon"></i> {{}}v{{ item.versionName }}</div>
          <div>{{ item.versionDescribe || '/' }}</div>
          <div>{{ item.updateTime || '/' }}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
  import { inject, Ref } from 'vue'

  import { AlgoItem } from '../index.vue'

  const algoItem: Ref<AlgoItem> = inject('algoItem')!
</script>

<style lang="less" scoped>
  @import '@/styles/mixins.less';

  #version-log {
    margin-bottom: 60px;

    .main {
      padding: 60px 0;
      background: url('@/assets/img/algo-service/algo-title-icon.svg') no-repeat;
      background-position: 716px 50px;
      background-size: 68px 64px;

      .title {
        position: relative;
        font-size: 30px;
        text-align: center;
        background: linear-gradient(180deg, rgba(14, 14, 40, 0.95) 0%, rgba(54, 54, 99, 0.95) 100%);
        background-clip: text;
        .fw500();

        line-height: 38px;
        -webkit-text-fill-color: transparent;

        img {
          position: absolute;
          top: -7px;
          left: 50%;
          z-index: 3;
          width: 68px;
          height: 64px;
        }
      }

      .a-list {
        overflow: hidden;
        margin-top: 56px;
        border: 1px solid #e8e8eb;
        border-bottom-width: 0;
        border-radius: 4px;

        .list-tr {
          display: flex;
          align-items: center;
          font-weight: 400;
          font-size: 14px;
          line-height: 22px;
          color: rgba(25, 25, 48, 0.75);
          background: #fff;
          border-bottom: 1px solid #e8e8eb;
          word-break: break-all;

          & > div {
            padding: 17px 24px;
          }

          & > div:nth-of-type(1) {
            display: flex;
            align-items: center;
            width: 200px;

            .icon {
              margin-right: 8px;
              font-size: 24px;
              background: linear-gradient(180deg, #4489f1 0%, #1d5cdf 47.4%, #134ec8 100%);
              -webkit-text-fill-color: transparent;
              background-clip: text;
            }
          }

          & > div:nth-of-type(2) {
            flex: 1;
          }

          & > div:nth-of-type(3) {
            width: 264px;
            text-align: right;
          }

          &.header {
            height: 48px;
            font-size: 14px;
            color: rgba(25, 25, 48, 0.45);
            font-weight: 700;
            background: #f2f2f5;
            line-height: 22px;
          }
        }
      }
    }
  }
</style>
